<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>象棋游戏</title>
    
   

	<script type="text/javascript" src="xiangqi3.js"></script>
</head>
<body>
    <div style="float: left; height:490; width:150px;">
        
        <div style="height:470px; width:150px; background:#ffffff" id="info"></div>
    </div>
    <div style="margin-left:20px; float: left">
         <canvas id="xiangqi" height="490" width="440" style="float: left"></canvas>
    </div>
    <script>
        var canvas, board, tds=[];
        window.onload = function(){
            canvas = document.getElementById("xiangqi");
            board = new Board(canvas, {
                width: 440,
                height: 490,
                margin: 20
            });
        }
        function undo(){
            if(board.undo(canvas)){
                tds.pop();
                resetTable();
            }
        }
        function warn(message){
            alert(message);
        }
        function info(message){
            if(tds.length == 10){
                tds.shift();
            }
            tds.push(message);
            resetTable();
        }
        function resetTable(){
            var html = "<table border=\"1\"><tr><td>";
            html += tds.join("</td></tr><tr><td>");
            html += "</td></tr></table>";
           document.getElementById("info").innerHTML = html;
        }
    </script>


    	<style></style>
	    		<script>var canvas, board, tds=[];
        window.onload = function(){
            canvas = document.getElementById("xiangqi");
            board = new Board(canvas, {
                width: 440,
                height: 490,
                margin: 20
            });
        }
        function undo(){
            if(board.undo(canvas)){
                tds.pop();
                resetTable();
            }
        }
        function warn(message){
            alert(message);
        }
        function info(message){
            if(tds.length > 10){
                tds.shift();
            }
            tds.push(message);
            resetTable();
        }
        function resetTable(){
            var html = "<div>";
            html += tds.join("</div><div>");
            html += "</div>";
           document.getElementById("info").innerHTML = html;
        }</script>
	
</body></html>